<template>
	<view class="page">
		<!-- search -->
		<view class=""
			style="display: flex;flex-direction: row;align-items: center;padding: 12px;background-color: #FFFFFF;">
			<view class="" @click="popBack()">
				<text class="iconfont icon-arrow-left" style="font-size: 16px;font-weight: bold;"></text>
				<text style="font-size: 16px;">教授管理</text>
			</view>
			<view
				style="margin-left: 12px;flex: 1;display: flex;align-items: center;flex-direction: row;background-color: #F1F1F1;height: 30px;border-radius: 15px;">
				<text class="iconfont icon-sousuo"
					style="font-size: 16px;font-weight: bold;color: #999999;margin-right: 10px;margin-left: 10px;"></text>
				<input type="text" value="" placeholder="请输入关键字搜索" style="font-size: 14px;flex: 1;" />
				<view style="width: 1px;height: 14px;background-color: #999999;margin-right: 12px;" />
				<text style="font-size: 14px;color: #007AFF;">搜索</text>
			</view>
		</view>
		<!-- list -->
		<view class="" style="flex: 1;background-color: #FF0000;overflow-y: auto;">
			<!-- cell -->
			<view @click="loadDetial(idx)" v-for="(item,idx) in list"
				style="padding: 12px; display: flex;flex-direction: row;align-items: center;background-color: #FFFFFF;">
				<!-- left -->
				<view style="flex: 1;flex-direction: column;display: flex;overflow: hidden;">
					<view class="" style="display: flex;align-items: center;">
						<text style="font-size: 16px;">{{item.name}}</text>
						<text style="font-size: 12px;color: #999999;margin-left: 12px;">{{item.serviceSchool}}</text>
					</view>
					<text style="font-size: 12px;color: #999999;margin-top: 5px;">{{item.briefIntroduction}}</text>
				</view>
				<!-- right -->
				<view
					style="
					display: flex;align-items: center;
					padding: 3px 10px;border-style: solid;border-width: 1px;border-color: #007AFF;border-radius: 16px;max-width: 90px;">
					<text style="text-align: center;font-size: 12px;color: #007AFF;display: block;">推送</text>
					<text class="iconfont icon-fasong"
						style="font-size: 10px;color: #007AFF;margin-left: 5px;display: block;"></text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		professorList
	} from "../../api/workbench.js"
	export default {
		data() {
			return {
				pageNum: 1,
				pageSize: 30,
				list: []
			}
		},
		created() {
			this.netProFessorList();
		},
		methods: {
			popBack() {
				uni.navigateBack({

				})
			},
			loadDetial(data) {
				uni.navigateTo({
					url: "/pages/teacher/teacher_detail"
				})
			},
			netProFessorList() {
				let fi = {
					pageNum: this.pageNum,
					pageSize: this.pageSize
				};
				let self = this;
				professorList(fi).then(res => {
					let {
						data
					} = res;
					let {
						record
					} = data;
					console.warn(JSON.stringify(res))
					self.list = record;
				}).catch(e => {
					console.warn(JSON.stringify(e))
				})
			}
		}
	}
</script>

<style scoped>
	.page {
		background-color: #f4f5f7;
		flex-direction: column;
		flex: 1;
		overflow: hidden;
		display: flex;
	}
</style>
